<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

		<title>采购发票新增</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" type="text/css" charset="UTF-8"
			href="<%=request.getContextPath()%>/css/public.css">
		<script language="JavaScript" charset="UTF-8"
			src="<%=request.getContextPath()%>/js/public.js"></script>
		<script language="JavaScript" charset="UTF-8"
			src="<%=request.getContextPath()%>/js/date1.js"></script>
		<script language="JavaScript" charset="UTF-8"
			src="<%=request.getContextPath()%>/js/stockInvoice.js"></script>
		<script language="JavaScript" charset="UTF-8"
			src="<%=request.getContextPath()%>/js/ajax.js"></script>
	</head>
	<body>
	<div id="info_all">
		<div id="info_top">
			采购发票详情
		</div>
		<!-- 主输入区 -->
		<!-- 功能按钮 -->
		<s:form action="addStockInvoice.action" method="post" theme="simple"
				 id="delrow" onsubmit=" return validate()" cssStyle="margin-top:0px;">
		<div id="info_main">
			<!-- 查询栏 -->
			<div id="info_input">
				<hr>
				<table>
					<tr>
					<!-- 
						<td>
							发票类型
						</td>
						<td>
							<select name="stockInvoiceModel.billType" style="width: 107px;">
								<option value="1" selected>
									普通发票
								</option>
								<option value="2">
									专业发票
								</option>
							</select>
						</td>
					 -->
						<td width="60px">
							红蓝字
						</td>
						<td width="130px">
							<s:if test="stockInvoiceModel.tag==1">蓝字</s:if>
							<s:else>红字</s:else>
						</td>
					</tr>
					<tr>
						<td>
							源单类型
						</td>
						<td width="130px">
							<s:if test="stockInvoiceModel.sourceBillType==1">采购订单</s:if>
							<s:elseif test="stockInvoiceModel.sourceBillType==2">采购入库</s:elseif>
						</td>
						<td width="50px">
							日期(*)
						</td>
						<td width="100px">
							<s:textfield name="stockInvoiceModel.invoiceDate" readonly="true"></s:textfield>
						</td>
						<td width="50px">
							币别(*)
						</td>
						<td>
							<s:textfield id="currencyName" size="12" readonly="true"></s:textfield>
						</td>
						<td width="50px">
							汇率(*)
						</td>
						<td width="130px">
							<s:textfield id="rate" name="rate" readonly="true" size="12" ></s:textfield>
						</td>

					</tr>
					<tr>

						<td width="80px">
							供应商(*)
						</td>
						<td width="130px">
							<s:textfield id="supplierName" size="12" readonly="true"></s:textfield>
						</td>
						<td>
							地址
						</td>
						<td>
							<s:textfield id="address" name="address" size="12" readonly="true"></s:textfield>
						</td>
						<td>
							开户银行
						</td>
						<td>
							<s:textfield id="openAccountBank" name="openAccountBank" size="12" readonly="true"></s:textfield>
						</td>
						<td>
							纳税登记号
						</td>
						<td>
							<s:textfield id="taxRegisterNo" name="taxRegisterNo" size="12" readonly="true"></s:textfield>
						</td>
						<td>
							发票号码(*)
						</td>
						<td width="100px">
							<s:textfield name="stockInvoiceModel.invoiceNo" size="12"
								id="invoiceNo"></s:textfield>
						</td>

					</tr>

					<tr>
						<td>
							采购方式(*)
						</td>
						<td width="108px">
							<select name="stockInvoiceModel.stockWay" style="width: 107px;">
								<option value="0" selected>
									现购
								</option>
								<option value="1">
									赊购
								</option>
							</select>
						</td>
						<td>
							付款期限
						</td>
						<td>
							<input name="stockInvoiceModel.payDate" size="12" value=''
								id='payDate' readonly='readonly' style='cursor: hand'
								onclick=calendar.setHook(this)>
						</td>
						<td>
							主管
						</td>
						<td>
							<s:hidden id="candiateId"></s:hidden>
							<s:hidden id="candiateName"></s:hidden>
							<s:hidden name="stockInvoiceModel.managerId" id="managerId"></s:hidden>
							<s:textfield name="" id="managerName" size="12" readonly="true"></s:textfield>
							<img src="images/kookup.gif" style="cursor:hand"  onclick="multiSelect2('candiateName','candiateId','managerName','managerId','selectMultiCandiate.action','candiate',700,800,0)">
						</td>

						<td>
							部门
						</td>
						<td>
							<s:hidden name="stockInvoiceModel.departmentId" id="departmentId"></s:hidden>
							<s:textfield name="" id="departmentName" size="12" readonly="true"></s:textfield>
							<img src="images/kookup.gif" style="cursor:hand"  onclick="openWin('selectDepartment.action','department',500,600,0)">
						</td>
						<td>
							业务员
						</td>
						<td>
							<s:hidden name="stockInvoiceModel.businessId" id="busnisserId"></s:hidden>
							<s:textfield name="" id="businesserName" size="12" readonly="true"></s:textfield>
							<img src="images/kookup.gif" style="cursor:hand"  onclick="multiSelect2('candiateName','candiateId','businesserName','busnisserId','selectMultiCandiate.action','candiate',500,600,0)">
						</td>
					</tr>
					<tr>

						<td>
							开票人
						</td>
						<td>
							<s:textfield name="stockInvoiceModel.ticketer" id="ticketerId"
								size="12"></s:textfield>
						</td>

						<td>
							摘要
						</td>
						<td colspan="3">
							<s:textfield name="stockInvoiceModel.remark" size="12"
								id="remark"></s:textfield>

						</td>

					</tr>
				</table>
				<hr>
			</div>
			<div class="sele" style="text-align: left; padding-left: 10px;">
				<input type="button" value="新增" onClick="addStockInvoiceRow()"
					onfocus="this.blur()" onMouseOver="this.className='btnover'"
					onmouseout="this.className='btnout'" class="btnsize" />
				<input type="button" value="删除" onClick="delrow()"
					onFocus="this.blur()" onMouseOver="this.className='btnover'"
					onmouseout="this.className='btnout'" class="btnsize" />
				<hr>
			</div>
			<!-- 信息显示栏 -->
			<div id="info_info4">
				<table id="info_table" width="2000px" cellspacing=1px
					cellpadding=1px class="sortable">
					<thead id="head">
						<tr>
							<th>
								<input type="checkbox" name="checkbox" onClick="selectAll()" />
							</th>
							<th width="80px">
								物料代码(*)
							</th>
							<th width="80px">
								物料名称
							</th>
							<th width="80px">
								规格型号
							</th>
							<th width="80px">
								辅助属性
							</th>
							<th width="80px">
								基本单位名称
							</th>
							<th width="80px">
								基本单位数量
							</th>
							<th width="80px">
								单位(*)
							</th>
							<th width="80px">
								数量
							</th>
							<th width="80px">
								单价
							</th>
							<th width="80px">
								折扣率(%)
							</th>
							<th width="80px">
								税率(%)
							</th>
							<th width="80px">
								含税单价
							</th>
							<th width="80px">
								实际含税单价
							</th>
							<th width="80px">
								金额
							</th>
							<th width="80px">
								金额（本位币）
							</th>
							<th width="80px">
								折扣额
							</th>
							<th width="80px">
								折扣额（本位币）
							</th>
							<th width="80px">
								税额
							</th>
							<th width="80px">
								税额（本位币）
							</th>
							<th width="80px">
								价税合计
							</th>
							<th width="80px">
								价税合计（本位币）
							</th>
							<th width="100px">
								订单含税单价
							</th>
							<th width="80px">
								备注
							</th>
							<th width="80px">
								源单单号
							</th>
							<th width="80px">
								订单单号
							</th>
						</tr>
					</thead>
					<tbody id="mbody">
					<s:if test="!stockInvoiceListModels.isEmpty">
									<s:iterator value="stockInvoiceListModels" status="stuts">
										<tr>
											<td>
												<s:checkbox name="rowlist"
													fieldValue="%{stockInvoiceListId}" theme="simple" />
											</td>
											<td>
												<s:hidden
													name="%{'stockInvoiceListModels['+#stuts.index+'].stockInvoiceListId'}"></s:hidden>
												<s:textfield
													name="%{'stockInvoiceListModels['+#stuts.index+'].materialModel.materialCode'}"
													size='11' readonly='true'></s:textfield>
												<s:hidden
													name="%{'stockInvoiceListModels['+#stuts.index+'].materialModel.materialId'}"></s:hidden>
											</td>
											<td>
												<s:textfield
													name="%{'stockInvoiceListModels['+#stuts.index+'].materialModel.materialName'}"
													size='11' readonly='true' />
											</td>
											<td>
												<s:textfield
													name="%{'stockInvoiceListModels['+#stuts.index+'].materialModel.materialSize'}"
													size='11' readonly='true' />
											</td>
											<td>
												<s:textfield
													name="%{'stockInvoiceListModels['+#stuts.index+'].measureUnitModel.unitName'}"
													size='11' readonly='true' />
												<s:hidden
													name="%{'stockInvoiceListModels['+#stuts.index+'].measureUnitModel.measureUnitId'}"></s:hidden>
											</td>
											<td>
												<s:textfield
													name="%{'stockInvoiceListModels['+#stuts.index+'].account'}"
													size='11' />
											</td>

											<td>
												<s:textfield
													name="%{'stockInvoiceListModels['+#stuts.index+'].unitPrice'}"
													size='11' />
											</td>
											<%--<td>
												<s:textfield
													name="%{'stockInvoiceListModels['+#stuts.index+'].totalUnitPrice'}"
													size='11' readonly='true' />
											</td>
											--%><td>
												<s:textfield
													name="%{'stockInvoiceListModels['+#stuts.index+'].discount'}"
													size='11' />
											</td>
											<td>
												<s:textfield
													name="%{'stockInvoiceListModels['+#stuts.index+'].dutyFrank'}"
													size='11' />
											</td>
											<%--<td>
												<s:textfield
													name="%{'stockInvoiceListModels['+#stuts.index+'].totalMoney'}"
													size='11' readonly='true' />
											</td>
											--%><td>
												<s:textfield
													name="%{'stockInvoiceListModels['+#stuts.index+'].remark'}"
													size='11' />
											</td>
										</tr>
									</s:iterator>
								</s:if>
					</tbody>
					<tfoot>
						<tr>
						</tr>
					</tfoot>
				</table>
				<script language="javascript">  
						//("表格名称","奇数行背景","偶数行背景","点击后背景");
						 mouseclick("info_table","#ffffff","#ffffff","#e6f0fd");
						 //("表格名称","奇数行背景","偶数行背景");
						 //setcolor("t","#ffffff","#ffffff");
				</script>
			</div>
			<div style="margin: 6px; text-align: center;">
				<input type="submit" value="保存"
					onFocus="this.blur()" onMouseOver="this.className='btnover'"
					onmouseout="this.className='btnout'" class="btnsize" />
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input type="button" value="返回" onClick=""
				onFocus="this.blur()" onMouseOver="this.className='btnover'"
				onmouseout="this.className='btnout'" class="btnsize" />
			</div>
		</div>
		</s:form>
	</div>
	</body>
</html>
